package com.wiz.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.wiz.mapper.GradeConfigMapper;
import com.wiz.service.GradeConfigService;
import com.wiz.to.GradeConfigTO;
@Service("gradeConfigService")
public class GradeConfigServiceImpl implements GradeConfigService {

	private Gson gson = new GsonBuilder().disableHtmlEscaping().create();
	private transient final Logger log = LoggerFactory.getLogger(getClass());

	@Resource
	private GradeConfigMapper gradeConfigMapper;
	
	
	@Override
	public List<GradeConfigTO> list() {
		return gradeConfigMapper.query();
	}

	@Override
	public GradeConfigTO getGradeConfig(int id) {
		List<GradeConfigTO>list = gradeConfigMapper.getGradeConfig(id);
		if(list != null && list.size()>0)return list.get(0);
		return null;
	}

	@Override
	public int add(GradeConfigTO gradeConfigTO) {
		return gradeConfigMapper.add(gradeConfigTO);
	}

	@Override
	public int remove(int id) {
		return gradeConfigMapper.remove(id);
	}

	@Override
	public int update(GradeConfigTO gradeConfigTO) {
		return gradeConfigMapper.update(gradeConfigTO);
	}

}
